import { createApp } from 'vue';
//iconfont 图标库

import '@/assets/iconfonts/iconfont.js';
import '@/assets/iconfonts/iconfont.css';
import '@/assets/elementIconfonts/iconfont.css';
import '@/assets/elementIconfonts/iconfont.js';

import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css';
import ContextMenu from '@imengyu/vue3-context-menu';
// global css
import 'virtual:uno.css';
import '@/assets/styles/index.scss';
import '@/assets/styles/global.less'
// import 'element-plus/theme-chalk/dark/css-vars.css';

// App、router、store
import App from './App.vue';
import store from './store';
import router from './router';

// 自定义指令
import directive from './directive';

// 注册插件
import plugins from './plugins/index'; // plugins

// 高亮组件
// import 'highlight.js/styles/a11y-light.css';
import 'highlight.js/styles/atom-one-dark.css';
import 'highlight.js/lib/common';
import HighLight from '@highlightjs/vue-plugin';

// svg图标
import 'virtual:svg-icons-register';
import ElementIcons from '@/plugins/svgicon';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import '@arco-design/web-vue/dist/arco.css';
// permission control
import './permission';

// 国际化
import i18n from '@/lang/index';

// vxeTable
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';
VXETable.config({
  zIndex: 999999
});

// 修改 el-dialog 默认点击遮照为不关闭
import { ElDialog } from 'element-plus';
ElDialog.props.closeOnClickModal.default = false;

//markdown样式高亮
import hljs from 'highlight.js';
// import 'highlight.js/styles/a11y-light.css' //样式
// import 'highlight.js/styles/atom-one-light.css' //样式
// import 'highlight.js/styles/atom-one-dark.css'


// 文件上传
import NewUploadDialog from '@/views/components/newUploadDialog/index.vue'; // 新上传
import ArcoVue from '@arco-design/web-vue';
import '@arco-design/web-vue/dist/arco.css';
const app = createApp(App);
app.component("NewUploadDialog", NewUploadDialog);

import Ellipsis from "@/components/common/Ellipsis.vue";
app.component("Ellipsis", Ellipsis);

//创建v-highlight全局指令
app.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})

app.use(ArcoVue);
app.use(ArcoVueIcon);
app.use(HighLight);
app.use(ElementIcons);
app.use(router);
app.use(store);
app.use(i18n);
app.use(VXETable);
app.use(plugins);
app.use(ContextMenu);
// 自定义指令
directive(app);

app.mount('#app');
